package com.molichuxing.services.infrastructure.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.molichuxing.framework.dao.RootMapper;
import com.molichuxing.services.infrastructure.bean.OrderMileageBean;

public interface OrderMileageMapper extends RootMapper<OrderMileageBean> {

	/**
	 * 根据主订单号和状态获取
	 * 
	 * @param masterOrderCode
	 *            主订单号
	 * @param status
	 *            状态
	 * @return
	 */
	List<OrderMileageBean> getList(@Param("masterOrderCode") Long masterOrderCode, @Param("status") Integer status);

	/**
	 * 获取有效加购里程订单（待支付、已支付）
	 * 
	 * @param masterOrderCode
	 *            主订单号
	 * @param statusList
	 *            状态
	 * @return
	 */
	List<OrderMileageBean> getEffectiveList(@Param("masterOrderCode") Long masterOrderCode,
			@Param("statusList") List<Integer> statusList);

	/**
	 * 根据订单号查询加购商品
	 * 
	 * @param orderCode
	 *            订单号
	 * @return
	 */
	OrderMileageBean getOrderMileage(@Param("orderCode") Long orderCode);

	/**
	 * 取消加购订单
	 * 
	 * @param orderCode
	 * @param wait
	 * @param canceled
	 * @return
	 */
	Integer cancel(@Param("orderCode") Long orderCode, @Param("wait") Integer wait,
			@Param("canceled") Integer canceled);

	/**
	 * 支付完成修改加购订单信息
	 * 
	 * @param orderMileageBean
	 * @param value
	 * @return
	 */
	Integer modifyPay(@Param("bean") OrderMileageBean orderMileageBean, @Param("oldStatus") Integer oldStatus);
}